{% extends "base.html" %}
{% block header %}修改密码{% endblock %}
{% block content %}
<div class="card shadow-sm rounded p-4 mb-4" style="max-width:400px;margin:auto;">
    <h4 class="mb-3">修改密码</h4>
    {% if error %}
    <div class="alert alert-danger">{{ error }}</div>
    {% endif %}
    {% if msg %}
    <div class="alert alert-success">{{ msg }}</div>
    {% endif %}
    <form method="post">
        {% csrf_token %}
        <div class="mb-3">
            <label for="old_password" class="form-label">原密码</label>
            <input type="password" class="form-control" id="old_password" name="old_password" required>
        </div>
        <div class="mb-3">
            <label for="new_password" class="form-label">新密码</label>
            <input type="password" class="form-control" id="new_password" name="new_password" required>
        </div>
        <div class="mb-3">
            <label for="confirm_password" class="form-label">确认新密码</label>
            <input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
        </div>
        <button type="submit" class="btn btn-success">保存</button>
        <a href="/" class="btn btn-secondary ms-2">取消</a>
    </form>
</div>
{% endblock %}
